﻿using System;
using System.ComponentModel;

namespace Infrastructure.CrossCutting.Configuration
{
    [AttributeUsage(AttributeTargets.Class)]
    public class ConfigurationFileAttribute : Attribute
    {
        public ConfigurationFileAttribute()
        {
            RootElementName = "Configuration";
            SectionElementName = "Section";
            SectionNameAttributeName = "name";
            ItemElementName = "Item";
            ItemKeyAttributeName = "name";
            ItemValueAttributeName = "value";
        }

        public string Name { get; set; }
        public string ConfigFilePath { get; set; }

        [DefaultValue("Configuration")]
        public string RootElementName { get; set; }

        [DefaultValue("Section")]
        public string SectionElementName { get; set; }

        [DefaultValue("name")]
        public string SectionNameAttributeName { get; set; }

        [DefaultValue("Item")]
        public string ItemElementName { get; set; }

        [DefaultValue("name")]
        public string ItemKeyAttributeName { get; set; }

        [DefaultValue("value")]
        public string ItemValueAttributeName { get; set; }
    }
}
